package com.hare.harelearn.Java.Aop.动态代理;

import java.lang.reflect.Proxy;

/**
 * @program: HareLearn
 * @description:
 * @author: Hare
 * @create: 2024−12-03 17:24
 * @Version 1.0
 **/
public class ProxyTest {
    public static void main(String[] args) {
        TargetService targetService = new TargetObject();
        JdkProxy jdkProxy = new JdkProxy(targetService);
        TargetService object = (TargetService)Proxy.newProxyInstance(TargetService.class.getClassLoader(), new Class[]{TargetService.class}, jdkProxy);
        object.proxy();
    }
}
